package lormi.meipin.util;

import java.util.ResourceBundle;

public class PropertiesUtils {

    private static ResourceBundle RESOURCE_RETURN_INFO = null;
    
    public static void init(){
    	RESOURCE_RETURN_INFO = ResourceBundle.getBundle((new StringBuilder("return-info")).toString());//获取错误代码编号
    }
    
    public static String getMsg(String code){
    	init();
    	String msg;
    	try{
    			msg = RESOURCE_RETURN_INFO.getString(code);
    	}catch(Exception e){
    		msg = "unknow";
    	}
    	return msg;
    }
    
    public static boolean isDebug(){
    	init();
    	String state = "";
    	try{
    		state = RESOURCE_RETURN_INFO.getString("000000");
    	}catch(Exception e){
			e.printStackTrace();
    	}
    	return ("debug".equals(state));
    }

}
